import { request } from '../../utils/request'

// 获取所有权限点
export const my = {
  Detail: () => {
    return request({ url: '/adminapp/my' })
  },

  // 绑定微信
  bindAdmin: data => {
    return request({
      url: '/adminapp/bind-admin',
      data,
      hideToast: true
    })
  },
  unBindAdmin: data => {
    return request({
      url: '/adminapp/remove-bind-admin',
      data,
      hideToast: true
    })
  },

  // 密码
  EditPassword: data => {
    return request({
      url: '/adminapp/modify-password',
      data,
      method: 'post',
      hideToast: true
    })
  },
  EditPasswordBycode: data => {
    return request({
      url: '/adminapp/modify-password-bycode',
      data,
      method: 'post',
      hideToast: true
    })
  },
  // 电话号码
  EditMobile: data => {
    return request({
      url: '/adminapp/modifyMobileStepOne',
      data,
      method: 'post',
      hideToast: true
    })
  },
  EditMobileTwo: data => {
    return request({
      url: '/adminapp/modifyMobileStepSecond',
      data,
      method: 'post',
      hideToast: true
    })
  },

  // 活动
  EditActive: data => {
    return request({
      url: '/adminapp/coupon-save',
      data,
      method: 'post',
      hideToast: true
    })
  },
  ActiveList: data => {
    return request({
      url: '/adminapp/coupon-list',
      data,
      hideToast: true
    })
  },
  ActiveDetail: id => {
    return request({
      url: '/adminapp/coupon-detail?id=' + id,
      hideToast: true
    })
  },
  ActiveDelete: data => {
    return request({
      url: '/adminapp/coupon-del',
      data,
      method: 'post',
      hideToast: true
    })
  },

  // 导购
  roleList: data => {
    return request({
      url: '/adminapp/user-list',
      hideToast: true
    })
  },
  roleOptions: data => {
    return request({
      url: '/adminapp/role-list',
      hideToast: true
    })
  },
  UserAdd: data => {
    return request({
      url: '/adminapp/user-add',
      data,
      method: 'post',
      hideToast: true
    })
  },
  UserDetail: data => {
    return request({
      url: '/adminapp/user-detail',
      data,
      hideToast: true
    })
  },
  UserEdit: data => {
    return request({
      url: '/adminapp/user-edit',
      data,
      method: 'post',
      hideToast: true
    })
  },

  // 卖场入驻
  joinStore: data => {
    return request({
      url: `/adminapp/search-store?name=${data}&limit=999`,
      hideToast: true
    })
  },
  joinBusiness: data => {
    return request({
      url: `/adminapp/search-business?name=${data}&limit=999`,
      hideToast: true
    })
  },
  join: data => {
    return request({
      url: `/adminapp/join`,
      method: 'post',
      data,
      hideToast: true
    })
  },
  joinStatus: data => {
    return request({
      url: `/adminapp/join-state?type=${data}`,
      hideToast: true
    })
  },
  Remove: data => {
    return request({
      url: `/adminapp/remove`,
      method: 'post',
      data,
      hideToast: true
    })
  }
}
